<template>
  <div v-loading="globalLoading" class="main-wrapper">
    <component :is="currentView" />
  </div>
</template>
<script>
import BasicLayout from '@/layouts/BasicLayout';
import BlankLayout from '@/layouts/BlankLayout';
import { mapState } from 'vuex';
import { useBlankLayoutRouteNames } from '@/constants';

export default {
  components: { BlankLayout, BasicLayout },
  data() {
    return { currentView: 'BlankLayout' };
  },
  computed: {
    ...mapState(['globalLoading']),
  },
  watch: {
    $route: function(route) {
      this.currentView = useBlankLayoutRouteNames.includes(route.name)
        ? 'BlankLayout'
        : 'BasicLayout';
    },
  },
};
</script>
<style lang="less" scoped></style>
